import aside from '@/views/aside'
import header from '@/views/header'
import main from '@/views/home'
import login from '@/views/login'
import departments from '@/views/hospital/department'
import doctor from '@/views/hospital/doctor'
import hospital from '@/views/hospital'
import updatadoctor from '@/views/hospital/updatedoctor'
const routes = [
  {
    path: '/', redirect: '/dashboard',
  },
  {
    path: '/login', name: 'login', component: login,
  },
  {
    path: '/dashboard',
    name: '首页',
    components: {
      aside,
      default: main,
      header,
    },
    meta: {
      icon: 'el-icon-location',
      islogin: 'true',
    },
  },
  {
    path: '/hospital',
    components: {
      aside,
      default: hospital,
      header,
    },
    meta: {
      icon: 'el-icon-location',
      islogin: 'true',
    },
    children: [
      {
        path: 'department',
        name: '科室管理',
        components: {
          default: departments,
        },
        meta: {
          icon: 'el-icon-location',
          islogin: 'true',
        },
      },
      {
        path: 'doctor',
        name: '医生管理',
        components: {
          default: doctor,
        },
        meta: {
          icon: 'el-icon-location',
          islogin: 'true',
        },
      },
      {
        path: 'doctor/edit',
        name: '编辑医生',
        components: {
          default: updatadoctor,
        },
        meta: {
          icon: 'el-icon-location',
          islogin: 'true',
        },
      },
    ],
  },
]
export default routes
